import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
// import HomeView from "../views/Home/HomeView.vue";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    redirect: "/login",
  },
  {
    path: "/home",
    component: () => import("../views/Home/HomeView.vue"),
    // 二级路由
    children: [
      {
        path: "/home",
        redirect: "/home/data",
      },
      {
        path: "/home/data",
        component: () => import("../views/Home/data/DataView.vue"),
      },
      {
        path: "/home/market",
        component: () => import("../views/Home/market/MarketView.vue"),
        children: [
          {
            path: "/home/market/activity",
            component: () =>
              import("../views/Home/market/activity/ActivityView.vue"),
          },
          {
            path: "/home/market/advertisement",
            component: () =>
              import(
                "../views/Home/market/advertisement/AdvertisementView.vue"
              ),
          },
        ],
      },
      {
        path: "/home/order",
        component: () => import("../views/Home/order/OrderView.vue"),
        children: [
          {
            path: "/home/order/all",
            component: () => import("../views/Home/order/all/AllOrder.vue"),
          },
          {
            path: "/home/order/evaluate",
            component: () =>
              import("../views/Home/order/evaluate/EvaluateView.vue"),
          },
        ],
      },
      {
        path: "/home/product",
        component: () => import("../views/Home/product/ProductView.vue"),
        children: [
          {
            path: "/home/product/classify",
            component: () =>
              import("../views/Home/product/classify/ClassifyView.vue"),
          },
          {
            path: "/home/product/puton",
            component: () =>
              import("../views/Home/product/puton/PutonView.vue"),
          },
          {
            path: "/home/product/release",
            component: () =>
              import("../views/Home/product/release/ReleaseView.vue"),
          },
          {
            path: "/home/product/stock",
            component: () =>
              import("../views/Home/product/stock/StockView.vue"),
          },
        ],
      },
      {
        path: "/home/shop",
        component: () => import("../views/Home/shop/ShopView.vue"),
        children: [
          {
            path: "/home/shop/mail",
            component: () => import("../views/Home/shop/mail/MailView.vue"),
          },
          {
            path: "/home/shop/property",
            component: () =>
              import("../views/Home/shop/property/PropertyView.vue"),
          },
          {
            path: "/home/shop/quality",
            component: () =>
              import("../views/Home/shop/quality/QualityView.vue"),
          },
        ],
      },
      {
        path: "/home/system",
        component: () => import("../views/Home/system/SystemView.vue"),
        children: [
          {
            path: "/home/system/syscenter",
            component: () =>
              import("../views/Home/system/syscenter/SystemCenter.vue"),
          },
          {
            path: "/home/system/set",
            component: () => import("../views/Home/system/set/SetView.vue"),
          },
        ],
      },
      {
        path: "/home/team",
        component: () => import("../views/Home/team/TeamView.vue"),
        children: [
          {
            path: "/home/team/manage/",
            component: () => import("../views/Home/team/manage/ManageView.vue"),
          },
          {
            path: "/home/team/member/",
            component: () => import("../views/Home/team/member/MemberView.vue"),
          },
        ],
      },
      {
        path: "/home/vip",
        component: () => import("../views/Home/vip/VipView.vue"),
        children: [
          {
            path: "/home/vip/center",
            component: () => import("../views/Home/vip/center/VipCenter.vue"),
          },
          {
            path: "/home/vip/my",
            component: () => import("../views/Home/vip/my/MyVip.vue"),
          },
        ],
      },
    ],
  },
  {
    path: "/login",
    component: () => import("../views/login/LoginView.vue"),
  },
  {
    path: "/:catchAll(.*)",
    component: () => import("../views/not/NotFound.vue"),
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
